<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CAN</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="kvaser.gif"/></td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___c_a_n.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">CAN<div class="ingroups"><a class="el" href="group__grp__canlib.html">CANlib</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>CAN related functions.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga55095b4ff633151ac4ccf06b1f3df1da"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga55095b4ff633151ac4ccf06b1f3df1da">kvBusParamsTq</a></td></tr>
<tr class="separator:ga55095b4ff633151ac4ccf06b1f3df1da"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga49525373a4d08d93c651ec10f79dd36b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga49525373a4d08d93c651ec10f79dd36b">canClose</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd)</td></tr>
<tr class="separator:ga49525373a4d08d93c651ec10f79dd36b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga99c7c99cc71580f8099a1407f4f9ea1a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga99c7c99cc71580f8099a1407f4f9ea1a">canBusOn</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd)</td></tr>
<tr class="separator:ga99c7c99cc71580f8099a1407f4f9ea1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf1786cfbfd542b18b9c599d278837bd9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gaf1786cfbfd542b18b9c599d278837bd9">canBusOff</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd)</td></tr>
<tr class="separator:gaf1786cfbfd542b18b9c599d278837bd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7eb8c2e92cfae57e7ec5031818524301"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga7eb8c2e92cfae57e7ec5031818524301">canSetBusParams</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, long freq, unsigned int tseg1, unsigned int tseg2, unsigned int sjw, unsigned int noSamp, unsigned int syncmode)</td></tr>
<tr class="separator:ga7eb8c2e92cfae57e7ec5031818524301"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga50f169c6f9dd6df93b17c322e8e4fd00"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga50f169c6f9dd6df93b17c322e8e4fd00">canSetBusParamsTq</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, const <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> nominal)</td></tr>
<tr class="separator:ga50f169c6f9dd6df93b17c322e8e4fd00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafcd85fbac103dcb123f4cd609be6fa14"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gafcd85fbac103dcb123f4cd609be6fa14">canSetBusParamsFd</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, long freq_brs, unsigned int tseg1_brs, unsigned int tseg2_brs, unsigned int sjw_brs)</td></tr>
<tr class="separator:gafcd85fbac103dcb123f4cd609be6fa14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4beeb28ede2e21a2988076e66f873723"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga4beeb28ede2e21a2988076e66f873723">canSetBusParamsFdTq</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, const <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> arbitration, const <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> data)</td></tr>
<tr class="separator:ga4beeb28ede2e21a2988076e66f873723"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf2a734c0486030610389331685a3827a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gaf2a734c0486030610389331685a3827a">canGetBusParams</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, long *freq, unsigned int *tseg1, unsigned int *tseg2, unsigned int *sjw, unsigned int *noSamp, unsigned int *syncmode)</td></tr>
<tr class="separator:gaf2a734c0486030610389331685a3827a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae517a9c243c446e040f6f8898d09a677"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gae517a9c243c446e040f6f8898d09a677">canGetBusParamsTq</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> *nominal)</td></tr>
<tr class="separator:gae517a9c243c446e040f6f8898d09a677"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab620a5cd6249e2e53cf2a0099e7e8685"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gab620a5cd6249e2e53cf2a0099e7e8685">canGetBusParamsFd</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, long *freq_brs, unsigned int *tseg1_brs, unsigned int *tseg2_brs, unsigned int *sjw_brs)</td></tr>
<tr class="separator:gab620a5cd6249e2e53cf2a0099e7e8685"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2ca01a0c71b8c3b5204f07b051eb4758"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga2ca01a0c71b8c3b5204f07b051eb4758">canGetBusParamsFdTq</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> *nominal, <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> *data)</td></tr>
<tr class="separator:ga2ca01a0c71b8c3b5204f07b051eb4758"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafca31590718ac7101d065b0c18b2410e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gafca31590718ac7101d065b0c18b2410e">canSetBusOutputControl</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, const unsigned int drivertype)</td></tr>
<tr class="separator:gafca31590718ac7101d065b0c18b2410e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1683419d56af8afdbfc9184678c82fdd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga1683419d56af8afdbfc9184678c82fdd">canGetBusOutputControl</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, unsigned int *drivertype)</td></tr>
<tr class="separator:ga1683419d56af8afdbfc9184678c82fdd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa4ffd2fad1932ad5763c2c923a1a12d8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gaa4ffd2fad1932ad5763c2c923a1a12d8">canAccept</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, const long envelope, const unsigned int flag)</td></tr>
<tr class="separator:gaa4ffd2fad1932ad5763c2c923a1a12d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaca3da209fe673b3838a50a3abe831855"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gaca3da209fe673b3838a50a3abe831855">canReadStatus</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, unsigned long *const flags)</td></tr>
<tr class="separator:gaca3da209fe673b3838a50a3abe831855"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadb3a712bd123317043cb73e1008075c8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gadb3a712bd123317043cb73e1008075c8">canReadErrorCounters</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, unsigned int *txErr, unsigned int *rxErr, unsigned int *ovErr)</td></tr>
<tr class="separator:gadb3a712bd123317043cb73e1008075c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga62c185329d6741c90102511e2f37983e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga62c185329d6741c90102511e2f37983e">canWrite</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, long id, void *msg, unsigned int dlc, unsigned int flag)</td></tr>
<tr class="separator:ga62c185329d6741c90102511e2f37983e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga304cb3a7bc2874c1f8ad361a911bcd5f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga304cb3a7bc2874c1f8ad361a911bcd5f">canWriteSync</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, unsigned long timeout)</td></tr>
<tr class="separator:ga304cb3a7bc2874c1f8ad361a911bcd5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga157d49a9343dea68ac953145e02266d8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga157d49a9343dea68ac953145e02266d8">canRead</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, long *id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)</td></tr>
<tr class="separator:ga157d49a9343dea68ac953145e02266d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac01f98e282609b5f6aaf2b1eabfb83ec"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gac01f98e282609b5f6aaf2b1eabfb83ec">canReadWait</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, long *id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time, unsigned long timeout)</td></tr>
<tr class="separator:gac01f98e282609b5f6aaf2b1eabfb83ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafb5e475233ef14ccf9084f610caba560"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gafb5e475233ef14ccf9084f610caba560">canReadSpecific</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, long id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)</td></tr>
<tr class="separator:gafb5e475233ef14ccf9084f610caba560"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga16356f4d646240ff2e640773d21f4d76"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga16356f4d646240ff2e640773d21f4d76">canReadSync</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, unsigned long timeout)</td></tr>
<tr class="separator:ga16356f4d646240ff2e640773d21f4d76"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4b21a0e2547c1435c378d13e6803acef"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga4b21a0e2547c1435c378d13e6803acef">canReadSyncSpecific</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, long id, unsigned long timeout)</td></tr>
<tr class="separator:ga4b21a0e2547c1435c378d13e6803acef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0eecb6695653d4dc6a4c0bb884a1b261"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga0eecb6695653d4dc6a4c0bb884a1b261">canReadSpecificSkip</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, long id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)</td></tr>
<tr class="separator:ga0eecb6695653d4dc6a4c0bb884a1b261"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa5dd0f277c7059169055321fbda87486"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gaa5dd0f277c7059169055321fbda87486">canSetNotify</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, void(*callback)(<a class="el" href="structcan_notify_data.html">canNotifyData</a> *), unsigned int notifyFlags, void *tag)</td></tr>
<tr class="separator:gaa5dd0f277c7059169055321fbda87486"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa1229ae7635c051a8f7fe545d9d8007a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gaa1229ae7635c051a8f7fe545d9d8007a">canGetRawHandle</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, void *pvFd)</td></tr>
<tr class="separator:gaa1229ae7635c051a8f7fe545d9d8007a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf38b95fce4930347d9986887ec046e13"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gaf38b95fce4930347d9986887ec046e13">canTranslateBaud</a> (long *const freq, unsigned int *const tseg1, unsigned int *const tseg2, unsigned int *const sjw, unsigned int *const nosamp, unsigned int *const syncMode)</td></tr>
<tr class="separator:gaf38b95fce4930347d9986887ec046e13"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa666085d9544b2c8db002599595edc37"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gaa666085d9544b2c8db002599595edc37">kvBitrateToBusParamsTq</a> (const <a class="el" href="canlib_8h.html#ae3d1b041d62207d5336f93c089cd5b65">canHandle</a> hnd, int freq, <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> *nominal)</td></tr>
<tr class="separator:gaa666085d9544b2c8db002599595edc37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga03be920624427856a9fde821ef3f9136"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga03be920624427856a9fde821ef3f9136">kvBitrateToBusParamsFdTq</a> (const <a class="el" href="canlib_8h.html#ae3d1b041d62207d5336f93c089cd5b65">canHandle</a> hnd, int freqA, int freqD, <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> *arbitration, <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> *data)</td></tr>
<tr class="separator:ga03be920624427856a9fde821ef3f9136"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac377d182232fb4ec2fed881c2b9ab300"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gac377d182232fb4ec2fed881c2b9ab300">canOpenChannel</a> (int channel, int flags)</td></tr>
<tr class="separator:gac377d182232fb4ec2fed881c2b9ab300"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac34c1577cae55385250e7412513c8cbd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gac34c1577cae55385250e7412513c8cbd">canSetBusParamsC200</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, unsigned char btr0, unsigned char btr1)</td></tr>
<tr class="separator:gac34c1577cae55385250e7412513c8cbd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae0bd6419b7a004c439dc582a53815c78"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gae0bd6419b7a004c439dc582a53815c78">canSetDriverMode</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, int lineMode, int resNet)</td></tr>
<tr class="separator:gae0bd6419b7a004c439dc582a53815c78"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacbb6c333badfaa092e9b239ad99478c9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gacbb6c333badfaa092e9b239ad99478c9">canGetDriverMode</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, int *lineMode, int *resNet)</td></tr>
<tr class="separator:gacbb6c333badfaa092e9b239ad99478c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaecc8b56e75cf68548af53b2d432079af"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gaecc8b56e75cf68548af53b2d432079af">canResetBus</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd)</td></tr>
<tr class="separator:gaecc8b56e75cf68548af53b2d432079af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga47d03bfcc31e290284e65211b61f15f3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga47d03bfcc31e290284e65211b61f15f3">canWriteWait</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, long id, void *msg, unsigned int dlc, unsigned int flag, unsigned long timeout)</td></tr>
<tr class="separator:ga47d03bfcc31e290284e65211b61f15f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabe5023aa5de3115de946a6a10232fe84"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gabe5023aa5de3115de946a6a10232fe84">canSetAcceptanceFilter</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, unsigned int code, unsigned int mask, int is_extended)</td></tr>
<tr class="separator:gabe5023aa5de3115de946a6a10232fe84"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7abcf8f512da6ab568850b9faa0bc28b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga7abcf8f512da6ab568850b9faa0bc28b">canFlushReceiveQueue</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd)</td></tr>
<tr class="separator:ga7abcf8f512da6ab568850b9faa0bc28b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga52a17bb8012bf025d127b4d29e5f3aa8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga52a17bb8012bf025d127b4d29e5f3aa8">canFlushTransmitQueue</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd)</td></tr>
<tr class="separator:ga52a17bb8012bf025d127b4d29e5f3aa8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaba3573e69435d87047c190520efdf5e5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gaba3573e69435d87047c190520efdf5e5">canRequestChipStatus</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd)</td></tr>
<tr class="separator:gaba3573e69435d87047c190520efdf5e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf7358e5ef5143e39c10b46d9cb592485"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#gaf7358e5ef5143e39c10b46d9cb592485">canRequestBusStatistics</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd)</td></tr>
<tr class="separator:gaf7358e5ef5143e39c10b46d9cb592485"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8d78ccbef4e6038ff63662f06b7cde65"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga8d78ccbef4e6038ff63662f06b7cde65">canGetBusStatistics</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, <a class="el" href="canlib_8h.html#a2bb3bba2f57c8222ace214f3f005c39c">canBusStatistics</a> *stat, size_t bufsiz)</td></tr>
<tr class="separator:ga8d78ccbef4e6038ff63662f06b7cde65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga909e5c14b09fe76bad280475138d503e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_n.html#ga909e5c14b09fe76bad280475138d503e">canGetHandleData</a> (const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> hnd, int item, void *buffer, size_t bufsize)</td></tr>
<tr class="separator:ga909e5c14b09fe76bad280475138d503e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>CAN related functions. </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga55095b4ff633151ac4ccf06b1f3df1da"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga55095b4ff633151ac4ccf06b1f3df1da">&#9670;&nbsp;</a></span>kvBusParamsTq</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a>  <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><b>Constraints</b> </p><pre class="fragment">Constraints that must be fulfilled when opening channel in classic CAN Mode:

  tq         = 1 + prop + phase1 + phase2
  tq        &gt;= 3
  sjw       &lt;= min(phase1, phase2)
  prescaler &gt;= 1
</pre><pre class="fragment">  Constraints that must be fulfilled when opening channel in CAN FD Mode:

  arbitration.tq         = 1 + arbitration.prop + arbitration.phase1 + arbitration.phase2
  arbitration.tq        &gt;= 3
  arbitration.sjw       &lt;= min(arbitration.phase1, arbitration.phase2)
  arbitration.prescaler &gt;= 1  (&lt;=2 will enable Transmitter Delay Compensation Mechanism)

  data.tq         = 1 + data.phase1 + data.phase2
  data.tq        &gt;= 3
  data.sjw       &lt;= min(data.phase1, data.phase2)
  data.prop       = 0
  data.prescaler  = arbitration.prescaler
</pre><p>Used in <a class="el" href="group___c_a_n.html#ga50f169c6f9dd6df93b17c322e8e4fd00">canSetBusParamsTq</a>, <a class="el" href="group___c_a_n.html#ga4beeb28ede2e21a2988076e66f873723">canSetBusParamsFdTq</a>, <a class="el" href="group___c_a_n.html#gae517a9c243c446e040f6f8898d09a677">canGetBusParamsTq</a> and <a class="el" href="group___c_a_n.html#gae517a9c243c446e040f6f8898d09a677">canGetBusParamsTq</a> </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaa4ffd2fad1932ad5763c2c923a1a12d8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa4ffd2fad1932ad5763c2c923a1a12d8">&#9670;&nbsp;</a></span>canAccept()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canAccept </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const long&#160;</td>
          <td class="paramname"><em>envelope</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned int&#160;</td>
          <td class="paramname"><em>flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This routine sets the message acceptance filters on a CAN channel.</p>
<p>On some boards the acceptance filtering is done by the CAN hardware; on other boards (typically those with an embedded CPU,) the acceptance filtering is done by software. <a class="el" href="group___c_a_n.html#gaa4ffd2fad1932ad5763c2c923a1a12d8">canAccept()</a> behaves in the same way for all boards, however.</p>
<p><a class="el" href="group___c_a_n.html#gabe5023aa5de3115de946a6a10232fe84">canSetAcceptanceFilter()</a> and <a class="el" href="group___c_a_n.html#gaa4ffd2fad1932ad5763c2c923a1a12d8">canAccept()</a> both serve the same purpose but the former can set the code and mask in just one call.</p>
<p>If you want to remove a filter, call <a class="el" href="group___c_a_n.html#gaa4ffd2fad1932ad5763c2c923a1a12d8">canAccept()</a> with the mask set to 0.</p>
<dl class="section note"><dt>Note</dt><dd>You can set the extended code and mask only on CAN boards that support extended identifiers.</dd>
<dd>
Acceptance filters for 11-bit and 29-bit (ext) are independent, meaning 11-bit filters will not affect 29-bit can frames and vice versa.</dd>
<dd>
Not all CAN boards support different masks for standard and extended CAN identifiers.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">envelope</td><td>The mask or code to set. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">flag</td><td>Any of <a class="el" href="canlib_8h.html#a9485f417c3629b9eb72d673b3ff16a5f">canFILTER_SET_CODE_STD</a>, <a class="el" href="canlib_8h.html#a8665c92e40adccfacc238af38b39f37e">canFILTER_SET_MASK_STD</a>, <a class="el" href="canlib_8h.html#a17172d69415cf42d7db3417d8109ec9f">canFILTER_SET_CODE_EXT</a> or <a class="el" href="canlib_8h.html#a3f55cdaf15a7d72f34e38d3b32a479c5">canFILTER_SET_MASK_EXT</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_user_guide_send_recv.html#section_user_guide_send_recv_filters">Acceptance Filters</a> </dd>
<dd>
<a class="el" href="group___c_a_n.html#gabe5023aa5de3115de946a6a10232fe84">canSetAcceptanceFilter()</a> </dd></dl>

</div>
</div>
<a id="gaf1786cfbfd542b18b9c599d278837bd9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf1786cfbfd542b18b9c599d278837bd9">&#9670;&nbsp;</a></span>canBusOff()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canBusOff </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Takes the specified handle off-bus. If no other handle is active on the same channel, the channel will also be taken off-bus</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN channel.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_user_guide_send_recv.html#section_user_guide_send_recv_bus_on_off">Bus On / Bus Off</a> </dd>
<dd>
<a class="el" href="group___c_a_n.html#ga99c7c99cc71580f8099a1407f4f9ea1a">canBusOn()</a>, <a class="el" href="group___c_a_n.html#gaecc8b56e75cf68548af53b2d432079af">canResetBus()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cancount_8c-example.html#a16">cancount.c</a>, <a class="el" href="canfdmonitor_8c-example.html#a16">canfdmonitor.c</a>, <a class="el" href="canfdwrite_8c-example.html#a17">canfdwrite.c</a>, <a class="el" href="canmonitor_8c-example.html#a30">canmonitor.c</a>, <a class="el" href="simplewrite_8c-example.html#a30">simplewrite.c</a>, <a class="el" href="tutorial_2c_2_monitor_can_channel_8c-example.html#a11">tutorial/c/MonitorCanChannel.c</a>, <a class="el" href="tutorial_2c_2_send_message_8c-example.html#a10">tutorial/c/SendMessage.c</a>, and <a class="el" href="writeloop_8c-example.html#a12">writeloop.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga99c7c99cc71580f8099a1407f4f9ea1a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga99c7c99cc71580f8099a1407f4f9ea1a">&#9670;&nbsp;</a></span>canBusOn()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canBusOn </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Takes the specified channel on-bus.</p>
<p>If you are using multiple handles to the same physical channel, for example if you are writing a threaded application, you must call <a class="el" href="group___c_a_n.html#ga99c7c99cc71580f8099a1407f4f9ea1a">canBusOn()</a> once for each handle. The same applies to <a class="el" href="group___c_a_n.html#gaf1786cfbfd542b18b9c599d278837bd9">canBusOff()</a> - the physical channel will not go off bus until the last handle to the channel goes off bus.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN channel.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_user_guide_send_recv.html#section_user_guide_send_recv_bus_on_off">Bus On / Bus Off</a> </dd>
<dd>
<a class="el" href="group___c_a_n.html#gaf1786cfbfd542b18b9c599d278837bd9">canBusOff()</a>, <a class="el" href="group___c_a_n.html#gaecc8b56e75cf68548af53b2d432079af">canResetBus()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cancount_8c-example.html#a9">cancount.c</a>, <a class="el" href="canfdmonitor_8c-example.html#a9">canfdmonitor.c</a>, <a class="el" href="canfdwrite_8c-example.html#a11">canfdwrite.c</a>, <a class="el" href="canmonitor_8c-example.html#a27">canmonitor.c</a>, <a class="el" href="simplewrite_8c-example.html#a27">simplewrite.c</a>, <a class="el" href="tutorial_2c_2_monitor_can_channel_8c-example.html#a10">tutorial/c/MonitorCanChannel.c</a>, <a class="el" href="tutorial_2c_2_send_message_8c-example.html#a7">tutorial/c/SendMessage.c</a>, and <a class="el" href="writeloop_8c-example.html#a9">writeloop.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga49525373a4d08d93c651ec10f79dd36b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga49525373a4d08d93c651ec10f79dd36b">&#9670;&nbsp;</a></span>canClose()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canClose </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Closes the channel associated with the handle. If no other threads are using the CAN circuit, it is taken off bus. The handle can not be used for further references to the channel, so any variable containing it should be zeroed.</p>
<p><a class="el" href="group___c_a_n.html#ga49525373a4d08d93c651ec10f79dd36b">canClose()</a> will almost always return <a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a>; the specified handle is closed on an best-effort basis.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN channel.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_user_guide_chips_channels.html#section_user_guide_init_sel_channel_close">Close Channel</a> </dd>
<dd>
<a class="el" href="group___c_a_n.html#gac377d182232fb4ec2fed881c2b9ab300">canOpenChannel()</a>, <a class="el" href="group___c_a_n.html#ga99c7c99cc71580f8099a1407f4f9ea1a">canBusOn()</a>, <a class="el" href="group___c_a_n.html#gaf1786cfbfd542b18b9c599d278837bd9">canBusOff()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cancount_8c-example.html#a17">cancount.c</a>, <a class="el" href="canfdmonitor_8c-example.html#a17">canfdmonitor.c</a>, <a class="el" href="canfdwrite_8c-example.html#a18">canfdwrite.c</a>, <a class="el" href="canmonitor_8c-example.html#a31">canmonitor.c</a>, <a class="el" href="example_2c_2busparams_tq_8c-example.html#a16">example/c/busparams_tq.c</a>, <a class="el" href="read_timer_test_8c-example.html#a5">readTimerTest.c</a>, <a class="el" href="simplewrite_8c-example.html#a31">simplewrite.c</a>, <a class="el" href="tutorial_2c_2_monitor_can_channel_8c-example.html#a12">tutorial/c/MonitorCanChannel.c</a>, <a class="el" href="tutorial_2c_2_send_message_8c-example.html#a11">tutorial/c/SendMessage.c</a>, and <a class="el" href="writeloop_8c-example.html#a13">writeloop.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga7abcf8f512da6ab568850b9faa0bc28b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7abcf8f512da6ab568850b9faa0bc28b">&#9670;&nbsp;</a></span>canFlushReceiveQueue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canFlushReceiveQueue </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function removes all received messages from the handle's receive queue. Other handles open to the same channel are not affected by this operation. That is, only the messages belonging to the handle you are passing to <a class="el" href="group___c_a_n.html#ga7abcf8f512da6ab568850b9faa0bc28b">canFlushReceiveQueue</a> are discarded.</p>
<dl class="section note"><dt>Note</dt><dd>This call has the same effect as calling <a class="el" href="group__can__general.html#gaeaa24db97af22478ca51d48636c7bb12">canIoCtl()</a> with a function code of <a class="el" href="canlib_8h.html#a1a07daae84b7fdcc3a90730530f9ca49">canIOCTL_FLUSH_RX_BUFFER</a>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open circuit.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#ga52a17bb8012bf025d127b4d29e5f3aa8">canFlushTransmitQueue()</a> </dd></dl>

</div>
</div>
<a id="ga52a17bb8012bf025d127b4d29e5f3aa8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga52a17bb8012bf025d127b4d29e5f3aa8">&#9670;&nbsp;</a></span>canFlushTransmitQueue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canFlushTransmitQueue </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function removes all messages pending transmission from the transmit queue of the circuit.</p>
<dl class="section note"><dt>Note</dt><dd>If there are other handles open to the same circuit, they are also flushed.</dd>
<dd>
This call has the same effect as calling <a class="el" href="group__can__general.html#gaeaa24db97af22478ca51d48636c7bb12">canIoCtl()</a> with a function code of <a class="el" href="canlib_8h.html#af3e37bd778bfba0891046c4e279aea99">canIOCTL_FLUSH_TX_BUFFER</a>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open circuit.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#ga7abcf8f512da6ab568850b9faa0bc28b">canFlushReceiveQueue()</a> </dd></dl>

</div>
</div>
<a id="ga1683419d56af8afdbfc9184678c82fdd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1683419d56af8afdbfc9184678c82fdd">&#9670;&nbsp;</a></span>canGetBusOutputControl()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canGetBusOutputControl </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>drivertype</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function retrieves the current CAN controller driver type. This corresponds loosely to the bus output control register in the CAN controller, hence the name of this function. CANlib does not allow for direct manipulation of the bus output control register; instead, symbolic constants are used to select the desired driver type.</p>
<dl class="section note"><dt>Note</dt><dd>Don't confuse the CAN controller driver type with the bus driver type. The CAN controller is not connected directly to the CAN bus; instead, it is connected to a bus transceiver circuit which interfaces directly to the bus. The "CAN controller driver type" we are talking about here refers to the mode which the CAN controller uses to drive the bus transceiver circuit.</dd>
<dd>
Silent Mode is not supported by all CAN controllers.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN circuit. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">drivertype</td><td>A pointer to an unsigned int which receives the current driver type. The driver type can be either <a class="el" href="canlib_8h.html#ae5d980394050f52fd4af8f8ca75a4bca">canDRIVER_NORMAL</a> or <a class="el" href="canlib_8h.html#ab82a818e60cddf4c65c54d42a474a023">canDRIVER_SILENT</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#gafca31590718ac7101d065b0c18b2410e">canSetBusOutputControl()</a> </dd></dl>

</div>
</div>
<a id="gaf2a734c0486030610389331685a3827a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf2a734c0486030610389331685a3827a">&#9670;&nbsp;</a></span>canGetBusParams()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canGetBusParams </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long *&#160;</td>
          <td class="paramname"><em>freq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>tseg1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>tseg2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>sjw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>noSamp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>syncmode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function retrieves the current nominal bus parameters for the specified channel.</p>
<p>The anatomy of a CAN bit is discussed in detail at Kvaser's web site at <a href="http://www.kvaser.com">www.kvaser.com</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN controller. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">freq</td><td>Bit rate (bits per second). </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">tseg1</td><td>Time segment 1, that is, the number of quanta from (but not including) the Sync Segment to the sampling point. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">tseg2</td><td>Time segment 2, that is, the number of quanta from the sampling point to the end of the bit. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">sjw</td><td>The Synchronization Jump Width. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">noSamp</td><td>The number of sampling points; can be 1 or 3. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">syncmode</td><td>Unsupported, always read as one.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_user_guide_chips_channels.html#section_user_guide_init_bit_rate_can">Set CAN Bitrate</a>, <a class="el" href="page_user_guide_chips_channels.html#section_user_guide_init_bit_rate_can">Set CAN Bitrate</a> </dd>
<dd>
<a class="el" href="group___c_a_n.html#ga7eb8c2e92cfae57e7ec5031818524301">canSetBusParams()</a>, <a class="el" href="group___c_a_n.html#gac34c1577cae55385250e7412513c8cbd">canSetBusParamsC200()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="busparams_8c-example.html#a7">busparams.c</a>.</dd>
</dl>
</div>
</div>
<a id="gab620a5cd6249e2e53cf2a0099e7e8685"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab620a5cd6249e2e53cf2a0099e7e8685">&#9670;&nbsp;</a></span>canGetBusParamsFd()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canGetBusParamsFd </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long *&#160;</td>
          <td class="paramname"><em>freq_brs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>tseg1_brs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>tseg2_brs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>sjw_brs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function retrieves the current data bus parameters for the specified CAN FD channel.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN FD controller. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">freq_brs</td><td>Bit rate (bits per second). </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">tseg1_brs</td><td>Time segment 1, that is, the number of quanta from (but not including) the Sync Segment to the sampling point. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">tseg2_brs</td><td>Time segment 2, that is, the number of quanta from the sampling point to the end of the bit. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">sjw_brs</td><td>The Synchronization Jump Width.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure </dd></dl>

</div>
</div>
<a id="ga2ca01a0c71b8c3b5204f07b051eb4758"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2ca01a0c71b8c3b5204f07b051eb4758">&#9670;&nbsp;</a></span>canGetBusParamsFdTq()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canGetBusParamsFdTq </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> *&#160;</td>
          <td class="paramname"><em>nominal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get bus parameters for the specified CAN controller.</p>
<p>If the channel is <b>NOT</b> opened (see <a class="el" href="group___c_a_n.html#gac377d182232fb4ec2fed881c2b9ab300">canOpenChannel()</a>) with flags <a class="el" href="canlib_8h.html#a10aad075bfb9891aa98cf3c131977dc3">canOPEN_CAN_FD</a> or <a class="el" href="canlib_8h.html#a692d91db67e06e0c11e9076141319e35">canOPEN_CAN_FD_NONISO</a>, use <a class="el" href="group___c_a_n.html#gae517a9c243c446e040f6f8898d09a677">canGetBusParamsTq()</a> instead.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open CAN circuit. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">nominal</td><td>See <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a>. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>See <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a>.</td></tr>
  </table>
  </dd>
</dl>
<p>return canOK (zero) if success return canERR_xxx (negative) if failure </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="example_2c_2busparams_tq_8c-example.html#a15">example/c/busparams_tq.c</a>.</dd>
</dl>
</div>
</div>
<a id="gae517a9c243c446e040f6f8898d09a677"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae517a9c243c446e040f6f8898d09a677">&#9670;&nbsp;</a></span>canGetBusParamsTq()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canGetBusParamsTq </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> *&#160;</td>
          <td class="paramname"><em>nominal</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get bus parameters for the specified CAN controller.</p>
<p>If the channel is opened (see <a class="el" href="group___c_a_n.html#gac377d182232fb4ec2fed881c2b9ab300">canOpenChannel()</a>) with flags <a class="el" href="canlib_8h.html#a10aad075bfb9891aa98cf3c131977dc3">canOPEN_CAN_FD</a> or <a class="el" href="canlib_8h.html#a692d91db67e06e0c11e9076141319e35">canOPEN_CAN_FD_NONISO</a>, use <a class="el" href="group___c_a_n.html#ga2ca01a0c71b8c3b5204f07b051eb4758">canGetBusParamsFdTq()</a> instead.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open CAN circuit. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">nominal</td><td>See <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a>.</td></tr>
  </table>
  </dd>
</dl>
<p>return canOK (zero) if success return canERR_xxx (negative) if failure </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="example_2c_2busparams_tq_8c-example.html#a8">example/c/busparams_tq.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga8d78ccbef4e6038ff63662f06b7cde65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8d78ccbef4e6038ff63662f06b7cde65">&#9670;&nbsp;</a></span>canGetBusStatistics()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canGetBusStatistics </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="canlib_8h.html#a2bb3bba2f57c8222ace214f3f005c39c">canBusStatistics</a> *&#160;</td>
          <td class="paramname"><em>stat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>bufsiz</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The <a class="el" href="group___c_a_n.html#ga8d78ccbef4e6038ff63662f06b7cde65">canGetBusStatistics()</a> function retrieves the latest bus statistics figures reported by the driver. You request the bus statistics from the driver by calling the <a class="el" href="group___c_a_n.html#gaf7358e5ef5143e39c10b46d9cb592485">canRequestBusStatistics()</a> function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN channel. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">stat</td><td>A pointer to a <a class="el" href="canlib_8h.html#a2bb3bba2f57c8222ace214f3f005c39c">canBusStatistics</a> struct that will receive the bus statistics figures. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">bufsiz</td><td>The size, in bytes, of the stat buffer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#gaf7358e5ef5143e39c10b46d9cb592485">canRequestBusStatistics()</a> </dd></dl>

</div>
</div>
<a id="gacbb6c333badfaa092e9b239ad99478c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacbb6c333badfaa092e9b239ad99478c9">&#9670;&nbsp;</a></span>canGetDriverMode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canGetDriverMode </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>lineMode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>resNet</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function retrieves the current CAN bus driver mode. This is typically a mode like sleep, wakeup, standby, fast mode, etc. The different modes are almost always hardware dependent and requires special DRVcan cables. As an example, the DRVcan S implements J2411 compliant single-wire CAN and supports four line modes, namely Normal, Sleep, Fast and Wakeup.</p>
<p>Standard ISO 11898 CAN do not support any of these bus driver modes.</p>
<dl class="section note"><dt>Note</dt><dd>The bus driver mode is typically used to control things like one- or two-wire mode, sleep mode, and so on. It requires special support in the CAN driver circuit.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN circuit. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">lineMode</td><td>A pointer to an int which receives the current line mode (<a class="el" href="canstat_8h.html#canTRANSCEIVER_LINEMODE_xxx">canTRANSCEIVER_LINEMODE_xxx</a>). </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">resNet</td><td>A pointer to an int which receives the current resnet mode. This value is usually <a class="el" href="canstat_8h.html#a3b7a3241ee88e905792b2630634a8373">canTRANSCEIVER_RESNET_NA</a> except for special DRVcan cables.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#gae0bd6419b7a004c439dc582a53815c78">canSetDriverMode()</a></dd></dl>
<dl class="section note"><dt>Note</dt><dd>Not implemented in linux. </dd></dl>

</div>
</div>
<a id="ga909e5c14b09fe76bad280475138d503e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga909e5c14b09fe76bad280475138d503e">&#9670;&nbsp;</a></span>canGetHandleData()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canGetHandleData </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>item</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>bufsize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section note"><dt>Note</dt><dd>This function can be used to retrieve certain pieces of information about an open handle to a CANlib channel.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN channel. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">item</td><td>This parameter specifies what data to obtain for the specified handle. The value is one of the constants <a class="el" href="canlib_8h.html#canCHANNELDATA_xxx">canCHANNELDATA_xxx</a> </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">buffer</td><td>The address of a buffer which is to receive the data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">bufsize</td><td>The size of the buffer to which the buffer parameter points.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_user_guide_device_and_channel.html#section_user_guide_unique_device">Channel Information</a> </dd>
<dd>
<a class="el" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData()</a> </dd></dl>

</div>
</div>
<a id="gaa1229ae7635c051a8f7fe545d9d8007a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa1229ae7635c051a8f7fe545d9d8007a">&#9670;&nbsp;</a></span>canGetRawHandle()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canGetRawHandle </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>pvFd</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns raw handle/file descriptor for use in system calls. </p><dl class="section note"><dt>Note</dt><dd>Use this function with caution.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>CanHandle </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">pvFd</td><td>Pointer to raw can data.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure </dd></dl>

</div>
</div>
<a id="gac377d182232fb4ec2fed881c2b9ab300"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac377d182232fb4ec2fed881c2b9ab300">&#9670;&nbsp;</a></span>canOpenChannel()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a> canOpenChannel </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>channel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Opens a CAN channel (circuit) and returns a handle which is used in subsequent calls to CANlib.</p>
<p>Channel numbering is dependent on the installed hardware. The first channel always has number 0.</p>
<p>For example,</p>
<ul>
<li>If you have a single LAPcan, the channels are numbered 0 and 1.</li>
</ul>
<ul>
<li>If you have a USBcan Professional, the channels are numbered 0-1 according to the labels on the cables.</li>
</ul>
<ul>
<li>The virtual channels come after all physical channels.</li>
</ul>
<p>If you are using multiple threads, note that the returned handle is usable only in the context of the thread that created it. That is, you must call <a class="el" href="group___c_a_n.html#gac377d182232fb4ec2fed881c2b9ab300">canOpenChannel()</a> in each of the threads in your application that uses the CAN bus. You can open the same channel from multiple threads, but you must call <a class="el" href="group___c_a_n.html#gac377d182232fb4ec2fed881c2b9ab300">canOpenChannel()</a> once per thread.</p>
<p>If you are using the same channel via multiple handles, note that the default behaviour is that the different handles will "hear" each other just as if each handle referred to a channel of its own. If you open, say, channel 0 from thread A and thread B and then send a message from thread A, it will be "received" by thread B. This behaviour can be changed using <a class="el" href="canlib_8h.html#a86f7ce6c809f30983b69ead49d793689">canIOCTL_SET_LOCAL_TXECHO</a>.</p>
<dl class="section note"><dt>Note</dt><dd>The handle returned may be zero which is perfectly valid.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">channel</td><td>The number of the channel. Channel numbering is hardware dependent. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">flags</td><td>A combination of <a class="el" href="canlib_8h.html#canOPEN_xxx">canOPEN_xxx</a> flags</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a handle to the opened circuit, or <a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if the call failed.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_user_guide_chips_channels.html">Open Channel</a>, <a class="el" href="page_user_guide_device_and_channel.html#section_user_guide_virtual">Virtual Channels</a> </dd>
<dd>
<a class="el" href="group___c_a_n.html#ga49525373a4d08d93c651ec10f79dd36b">canClose()</a>, <a class="el" href="group__can__general.html#ga65169ca633cd30aa92b8a80e28a5378b">canGetNumberOfChannels()</a>, <a class="el" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData()</a>, <a class="el" href="group__can__general.html#gaeaa24db97af22478ca51d48636c7bb12">canIoCtl()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="busparams_8c-example.html#a3">busparams.c</a>, <a class="el" href="cancount_8c-example.html#a3">cancount.c</a>, <a class="el" href="canfdmonitor_8c-example.html#a3">canfdmonitor.c</a>, <a class="el" href="canfdwrite_8c-example.html#a3">canfdwrite.c</a>, <a class="el" href="canmonitor_8c-example.html#a15">canmonitor.c</a>, <a class="el" href="example_2c_2busparams_tq_8c-example.html#a4">example/c/busparams_tq.c</a>, <a class="el" href="how-to_2c_2open_channels_8c-example.html#a2">how-to/c/openChannels.c</a>, <a class="el" href="read_timer_test_8c-example.html#a3">readTimerTest.c</a>, <a class="el" href="simplewrite_8c-example.html#a15">simplewrite.c</a>, <a class="el" href="tutorial_2c_2_monitor_can_channel_8c-example.html#a6">tutorial/c/MonitorCanChannel.c</a>, <a class="el" href="tutorial_2c_2_send_message_8c-example.html#a3">tutorial/c/SendMessage.c</a>, and <a class="el" href="writeloop_8c-example.html#a3">writeloop.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga157d49a9343dea68ac953145e02266d8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga157d49a9343dea68ac953145e02266d8">&#9670;&nbsp;</a></span>canRead()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canRead </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long *&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>dlc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>flag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long *&#160;</td>
          <td class="paramname"><em>time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reads a message from the receive buffer. If no message is available, the function returns immediately with return code <a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a734089f351bc421c230bf8b6cd9b1e8e">canERR_NOMSG</a>.</p>
<p>If you are using the same channel via multiple handles, note that the default behaviour is that the different handles will "hear" each other just as if each handle referred to a channel of its own. If you open, say, channel 0 from thread A and thread B and then send a message from thread A, it will be "received" by thread B. This behaviour can be changed using <a class="el" href="canlib_8h.html#a86f7ce6c809f30983b69ead49d793689">canIOCTL_SET_LOCAL_TXECHO</a>.</p>
<p>It is allowed to pass <code>NULL</code> as the value of <em>id</em>, <em>msg</em>, <em>dlc</em>, <em>flag</em>, and <em>time</em>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open circuit. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">id</td><td>Pointer to a buffer which receives the CAN identifier. This buffer will only get the identifier. To determine whether this identifier was standard (11-bit) or extended (29-bit), and/or whether it was remote or not, or if it was an error frame, examine the contents of the flag argument. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">msg</td><td>Pointer to the buffer which receives the message data. This buffer must be large enough (i.e. 8 bytes for classic CAN and up to 64 bytes for CAN FD). </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">dlc</td><td>Pointer to a buffer which receives the message length. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">flag</td><td>Pointer to a buffer which receives the message flags, which is a combination of the <a class="el" href="canstat_8h.html#canMSG_xxx">canMSG_xxx</a> (including <a class="el" href="canstat_8h.html#canFDMSG_xxx">canFDMSG_xxx</a> if the CAN FD protocol is enabled) and <a class="el" href="canstat_8h.html#canMSGERR_xxx">canMSGERR_xxx</a> values. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">time</td><td>Pointer to a buffer which receives the message time stamp. The unit of the time stamp is configurable using <a class="el" href="canlib_8h.html#a5b5d43fc8968aa77e48ef8c8d3036c36">canIOCTL_SET_TIMER_SCALE</a>, default is 1 ms.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if a message was read. </dd>
<dd>
<a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a734089f351bc421c230bf8b6cd9b1e8e">canERR_NOMSG</a> (negative) if there was no message available. </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_user_guide_send_recv.html#section_user_guide_send_recv_reading">Reading Messages</a>, <a class="el" href="page_user_guide_send_recv_mailboxes.html">Message Mailboxes</a>, <a class="el" href="page_user_guide_send_recv.html#section_user_guide_send_recv_reading">Reading Messages</a> page_user_guide_time Time Measurement</dd>
<dd>
<a class="el" href="group___c_a_n.html#gafb5e475233ef14ccf9084f610caba560">canReadSpecific()</a>, <a class="el" href="group___c_a_n.html#ga0eecb6695653d4dc6a4c0bb884a1b261">canReadSpecificSkip()</a>, <a class="el" href="group___c_a_n.html#ga16356f4d646240ff2e640773d21f4d76">canReadSync()</a>, <a class="el" href="group___c_a_n.html#ga4b21a0e2547c1435c378d13e6803acef">canReadSyncSpecific()</a>, <a class="el" href="group___c_a_n.html#gac01f98e282609b5f6aaf2b1eabfb83ec">canReadWait()</a>, <a class="el" href="group__can__general.html#gaeaa24db97af22478ca51d48636c7bb12">canIoCtl()</a> </dd></dl>

</div>
</div>
<a id="gadb3a712bd123317043cb73e1008075c8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadb3a712bd123317043cb73e1008075c8">&#9670;&nbsp;</a></span>canReadErrorCounters()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canReadErrorCounters </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>txErr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>rxErr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>ovErr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reads the error counters of the CAN controller.</p>
<p><a class="el" href="group___c_a_n.html#gadb3a712bd123317043cb73e1008075c8">canReadErrorCounters()</a> returns the latest known values of the error counters in the specified circuit. If the error counters change values precisely when <a class="el" href="group___c_a_n.html#gadb3a712bd123317043cb73e1008075c8">canReadErrorCounters()</a> is called, it may not be reflected in the returned result.</p>
<p>It is allowed to pass <code>NULL</code> as the value of the <em>txErr</em>, <em>rxErr</em>, and <em>ovErr</em> parameters.</p>
<p>Use <a class="el" href="group__can__general.html#gaeaa24db97af22478ca51d48636c7bb12">canIoCtl()</a> to clear the counters.</p>
<dl class="section note"><dt>Note</dt><dd>Not all CAN controllers provide access to the error counters; in this case, an educated guess is returned.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open circuit. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">txErr</td><td>A pointer to a <code>DWORD</code> which receives the transmit error counter. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">rxErr</td><td>A pointer to a <code>DWORD</code> which receives the receive error counter. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">ovErr</td><td>A pointer to a <code>DWORD</code> which receives the number of overrun errors.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__can__general.html#gaeaa24db97af22478ca51d48636c7bb12">canIoCtl()</a> </dd></dl>

</div>
</div>
<a id="gafb5e475233ef14ccf9084f610caba560"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafb5e475233ef14ccf9084f610caba560">&#9670;&nbsp;</a></span>canReadSpecific()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canReadSpecific </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>dlc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>flag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long *&#160;</td>
          <td class="paramname"><em>time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reads a message with a specified identifier from the receive buffer. Any preceding message not matching the specified identifier will be kept in the receive buffer. If no message with the specified identifier is available, the function returns immediately with an error code.</p>
<p>If you are using the same channel via multiple handles, note that the default behaviour is that the different handles will "hear" each other just as if each handle referred to a channel of its own. If you open, say, channel 0 from thread A and thread B and then send a message from thread A, it will be "received" by thread B. This behaviour can be changed using <a class="el" href="canlib_8h.html#a86f7ce6c809f30983b69ead49d793689">canIOCTL_SET_LOCAL_TXECHO</a>.</p>
<p>It is allowed to pass <code>NULL</code> as the value of <em>msg</em>, <em>dlc</em>, <em>flag</em>, and <em>time</em>.</p>
<dl class="section note"><dt>Note</dt><dd>Use <a class="el" href="group___c_a_n.html#gafb5e475233ef14ccf9084f610caba560">canReadSpecific</a> only if you for some reason must keep the unread messages in the queue. If this is not the case, consider using <a class="el" href="group___c_a_n.html#ga0eecb6695653d4dc6a4c0bb884a1b261">canReadSpecificSkip()</a> or <a class="el" href="group___c_a_n.html#ga157d49a9343dea68ac953145e02266d8">canRead()</a> for better performance.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>The desired CAN identifier. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">msg</td><td>Pointer to the buffer which receives the message data. This buffer must be large enough (i.e. 8 bytes for classic CAN and up to 64 bytes for CAN FD). </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">dlc</td><td>Pointer to a buffer which receives the message length. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">flag</td><td>Pointer to a buffer which receives the message flags, which is a combination of the <a class="el" href="canstat_8h.html#canMSG_xxx">canMSG_xxx</a> (including <a class="el" href="canstat_8h.html#canFDMSG_xxx">canFDMSG_xxx</a> if the CAN FD protocol is enabled) and <a class="el" href="canstat_8h.html#canMSGERR_xxx">canMSGERR_xxx</a> values. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">time</td><td>Pointer to a buffer which receives the message time stamp.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if a message was read. </dd>
<dd>
<a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a734089f351bc421c230bf8b6cd9b1e8e">canERR_NOMSG</a> (negative) if a matching message was not found. There might be other messages in the queue, though. </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_user_guide_send_recv_mailboxes.html">Message Mailboxes</a>, <a class="el" href="page_user_guide_send_recv.html#section_user_guide_send_recv_reading">Reading Messages</a>, <a class="el" href="page_user_guide_time.html">Time Measurement</a> Time Measurement </dd>
<dd>
<a class="el" href="group___c_a_n.html#ga157d49a9343dea68ac953145e02266d8">canRead()</a>, <a class="el" href="group___c_a_n.html#ga0eecb6695653d4dc6a4c0bb884a1b261">canReadSpecificSkip()</a>, <a class="el" href="group___c_a_n.html#ga16356f4d646240ff2e640773d21f4d76">canReadSync()</a>, <a class="el" href="group___c_a_n.html#ga4b21a0e2547c1435c378d13e6803acef">canReadSyncSpecific()</a>, <a class="el" href="group___c_a_n.html#gac01f98e282609b5f6aaf2b1eabfb83ec">canReadWait()</a> </dd></dl>

</div>
</div>
<a id="ga0eecb6695653d4dc6a4c0bb884a1b261"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0eecb6695653d4dc6a4c0bb884a1b261">&#9670;&nbsp;</a></span>canReadSpecificSkip()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canReadSpecificSkip </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>dlc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>flag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long *&#160;</td>
          <td class="paramname"><em>time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reads a message with a specified identifier from the receive buffer. Any preceding message not matching the specified identifier will be removed in the receive buffer. If no message with the specified identifier is available, the function returns immediately with an error code.</p>
<p>If you are using the same channel via multiple handles, note that the default behaviour is that the different handles will "hear" each other just as if each handle referred to a channel of its own. If you open, say, channel 0 from thread A and thread B and then send a message from thread A, it will be "received" by thread B. This behaviour can be changed using <a class="el" href="canlib_8h.html#a86f7ce6c809f30983b69ead49d793689">canIOCTL_SET_LOCAL_TXECHO</a>.</p>
<p>It is allowed to pass <code>NULL</code> as the value of <em>msg</em>, <em>dlc</em>, <em>flag</em>, and <em>time</em>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>The desired CAN identifier. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">msg</td><td>Pointer to the buffer which receives the message data. This buffer must be large enough (i.e. 8 bytes for classic CAN and up to 64 bytes for CAN FD). </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">dlc</td><td>Pointer to a buffer which receives the message length. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">flag</td><td>Pointer to a buffer which receives the message flags, which is a combination of the <a class="el" href="canstat_8h.html#canMSG_xxx">canMSG_xxx</a> (including <a class="el" href="canstat_8h.html#canFDMSG_xxx">canFDMSG_xxx</a> if the CAN FD protocol is enabled) and <a class="el" href="canstat_8h.html#canMSGERR_xxx">canMSGERR_xxx</a> values. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">time</td><td>Pointer to a buffer which receives the message time stamp.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if a matching message was found. </dd>
<dd>
<a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a734089f351bc421c230bf8b6cd9b1e8e">canERR_NOMSG</a> if there was no matching message available. All other messages (if any!) were discarded. </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_user_guide_send_recv.html#section_user_guide_send_recv_reading">Reading Messages</a>, <a class="el" href="page_user_guide_time.html">Time Measurement</a> Time Measurement </dd>
<dd>
<a class="el" href="group___c_a_n.html#ga157d49a9343dea68ac953145e02266d8">canRead()</a>, <a class="el" href="group___c_a_n.html#gafb5e475233ef14ccf9084f610caba560">canReadSpecific()</a>, <a class="el" href="group___c_a_n.html#ga16356f4d646240ff2e640773d21f4d76">canReadSync()</a>, <a class="el" href="group___c_a_n.html#ga4b21a0e2547c1435c378d13e6803acef">canReadSyncSpecific()</a>, <a class="el" href="group___c_a_n.html#gac01f98e282609b5f6aaf2b1eabfb83ec">canReadWait()</a> </dd></dl>

</div>
</div>
<a id="gaca3da209fe673b3838a50a3abe831855"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaca3da209fe673b3838a50a3abe831855">&#9670;&nbsp;</a></span>canReadStatus()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canReadStatus </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long *const&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns the status for the specified circuit. flags points to a longword which receives a combination of the <a class="el" href="canstat_8h.html#canSTAT_xxx">canSTAT_xxx</a> flags.</p>
<dl class="section note"><dt>Note</dt><dd><a class="el" href="group___c_a_n.html#gaca3da209fe673b3838a50a3abe831855">canReadStatus()</a> returns the latest known status of the specified circuit. If a status change happens precisely when <a class="el" href="group___c_a_n.html#gaca3da209fe673b3838a50a3abe831855">canReadStatus()</a> is called, it may not be reflected in the returned result.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open circuit. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">flags</td><td>Pointer to a <code>DWORD</code> which receives the status flags; this is a combination of any of the <a class="el" href="canstat_8h.html#canSTAT_xxx">canSTAT_xxx</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure </dd></dl>

</div>
</div>
<a id="ga16356f4d646240ff2e640773d21f4d76"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga16356f4d646240ff2e640773d21f4d76">&#9670;&nbsp;</a></span>canReadSync()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canReadSync </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Waits until the receive buffer contains at least one message or a timeout occurs.</p>
<p>If you are using the same channel via multiple handles, note that the default behaviour is that the different handles will "hear" each other just as if each handle referred to a channel of its own. If you open, say, channel 0 from thread A and thread B and then send a message from thread A, it will be "received" by thread B. This behaviour can be changed using <a class="el" href="canlib_8h.html#a86f7ce6c809f30983b69ead49d793689">canIOCTL_SET_LOCAL_TXECHO</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>The timeout in milliseconds. 0xFFFFFFFF gives an infinite timeout.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if the queue contains the desired message. </dd>
<dd>
<a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7acd1c4c3a87dd24f0a43753ee4bfe7993">canERR_TIMEOUT</a> (negative) if a timeout occurs before a message arrived. </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if the call fails.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#ga157d49a9343dea68ac953145e02266d8">canRead()</a>, <a class="el" href="group___c_a_n.html#gafb5e475233ef14ccf9084f610caba560">canReadSpecific()</a>, <a class="el" href="group___c_a_n.html#ga0eecb6695653d4dc6a4c0bb884a1b261">canReadSpecificSkip()</a>, <a class="el" href="group___c_a_n.html#ga4b21a0e2547c1435c378d13e6803acef">canReadSyncSpecific()</a>, <a class="el" href="group___c_a_n.html#gac01f98e282609b5f6aaf2b1eabfb83ec">canReadWait()</a> </dd></dl>

</div>
</div>
<a id="ga4b21a0e2547c1435c378d13e6803acef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4b21a0e2547c1435c378d13e6803acef">&#9670;&nbsp;</a></span>canReadSyncSpecific()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canReadSyncSpecific </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Waits until the receive queue contains a message with the specified id, or a timeout occurs..</p>
<p>If you are using the same channel via multiple handles, note that the default behaviour is that the different handles will "hear" each other just as if each handle referred to a channel of its own. If you open, say, channel 0 from thread A and thread B and then send a message from thread A, it will be "received" by thread B. This behaviour can be changed using <a class="el" href="canlib_8h.html#a86f7ce6c809f30983b69ead49d793689">canIOCTL_SET_LOCAL_TXECHO</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>The desired message identifier. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>The timeout in milliseconds. 0xFFFFFFFF gives an infinite timeout.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if the queue contains the desired message. </dd>
<dd>
<a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7acd1c4c3a87dd24f0a43753ee4bfe7993">canERR_TIMEOUT</a> (negative) if a timeout occurs before the specified message arrived. </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if the call fails.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#ga157d49a9343dea68ac953145e02266d8">canRead()</a>, <a class="el" href="group___c_a_n.html#gafb5e475233ef14ccf9084f610caba560">canReadSpecific()</a>, <a class="el" href="group___c_a_n.html#ga0eecb6695653d4dc6a4c0bb884a1b261">canReadSpecificSkip()</a>, <a class="el" href="group___c_a_n.html#ga16356f4d646240ff2e640773d21f4d76">canReadSync()</a>, <a class="el" href="group___c_a_n.html#gac01f98e282609b5f6aaf2b1eabfb83ec">canReadWait()</a> </dd></dl>

</div>
</div>
<a id="gac01f98e282609b5f6aaf2b1eabfb83ec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac01f98e282609b5f6aaf2b1eabfb83ec">&#9670;&nbsp;</a></span>canReadWait()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canReadWait </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long *&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>dlc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>flag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long *&#160;</td>
          <td class="paramname"><em>time</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reads a message from the receive buffer. If no message is available, the function waits until a message arrives or a timeout occurs.</p>
<p>If you are using the same channel via multiple handles, note that the default behaviour is that the different handles will "hear" each other just as if each handle referred to a channel of its own. If you open, say, channel 0 from thread A and thread B and then send a message from thread A, it will be "received" by thread B. This behaviour can be changed using <a class="el" href="canlib_8h.html#a86f7ce6c809f30983b69ead49d793689">canIOCTL_SET_LOCAL_TXECHO</a>.</p>
<p>It is allowed to pass <code>NULL</code> as the value of <em>id</em>, <em>msg</em>, <em>dlc</em>, <em>flag</em>, and <em>time</em>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open circuit. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">id</td><td>Pointer to a buffer which receives the CAN identifier. This buffer will only get the identifier. To determine whether this identifier was standard (11-bit) or extended (29-bit), and/or whether it was remote or not, or if it was an error frame, examine the contents of the flag argument. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">msg</td><td>Pointer to the buffer which receives the message data. This buffer must be large enough (i.e. 8 bytes for classic CAN and up to 64 bytes for CAN FD). </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">dlc</td><td>Pointer to a buffer which receives the message length. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">flag</td><td>Pointer to a buffer which receives the message flags, which is a combination of the <a class="el" href="canstat_8h.html#canMSG_xxx">canMSG_xxx</a> (including <a class="el" href="canstat_8h.html#canFDMSG_xxx">canFDMSG_xxx</a> if the CAN FD protocol is enabled) and <a class="el" href="canstat_8h.html#canMSGERR_xxx">canMSGERR_xxx</a> values. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">time</td><td>Pointer to a buffer which receives the message time stamp. The unit of the time stamp is configurable using <a class="el" href="canlib_8h.html#a5b5d43fc8968aa77e48ef8c8d3036c36">canIOCTL_SET_TIMER_SCALE</a>, default is 1 ms. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>If no message is immediately available, this parameter gives the number of milliseconds to wait for a message before returning. 0xFFFFFFFF gives an infinite timeout.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if a message was read. </dd>
<dd>
<a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a734089f351bc421c230bf8b6cd9b1e8e">canERR_NOMSG</a> (negative) if there was no message available. </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#ga157d49a9343dea68ac953145e02266d8">canRead()</a>, <a class="el" href="group___c_a_n.html#gafb5e475233ef14ccf9084f610caba560">canReadSpecific()</a>, <a class="el" href="group___c_a_n.html#ga0eecb6695653d4dc6a4c0bb884a1b261">canReadSpecificSkip()</a>, <a class="el" href="group___c_a_n.html#ga4b21a0e2547c1435c378d13e6803acef">canReadSyncSpecific()</a>, <a class="el" href="group___c_a_n.html#ga16356f4d646240ff2e640773d21f4d76">canReadSync()</a>, <a class="el" href="group__can__general.html#gaeaa24db97af22478ca51d48636c7bb12">canIoCtl()</a></dd>
<dd>
<a class="el" href="page_user_guide_time.html">Time Measurement</a> Time Measurement </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cancount_8c-example.html#a10">cancount.c</a>, <a class="el" href="canfdmonitor_8c-example.html#a10">canfdmonitor.c</a>, <a class="el" href="canmonitor_8c-example.html#a28">canmonitor.c</a>, and <a class="el" href="tutorial_2c_2_monitor_can_channel_8c-example.html#a2">tutorial/c/MonitorCanChannel.c</a>.</dd>
</dl>
</div>
</div>
<a id="gaf7358e5ef5143e39c10b46d9cb592485"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf7358e5ef5143e39c10b46d9cb592485">&#9670;&nbsp;</a></span>canRequestBusStatistics()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canRequestBusStatistics </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The <a class="el" href="group___c_a_n.html#gaf7358e5ef5143e39c10b46d9cb592485">canRequestBusStatistics</a> function requests bus statistics from the hardware. The bus statistics figures can be retrieved later by a call to the <a class="el" href="group___c_a_n.html#ga8d78ccbef4e6038ff63662f06b7cde65">canGetBusStatistics</a> function.</p>
<dl class="section note"><dt>Note</dt><dd>The time between a call to <a class="el" href="group___c_a_n.html#gaf7358e5ef5143e39c10b46d9cb592485">canRequestBusStatistics()</a> and the point in time where the bus statistics is actually available via a call to <a class="el" href="group___c_a_n.html#ga8d78ccbef4e6038ff63662f06b7cde65">canGetBusStatistics()</a> is not defined. Typically, you would call <a class="el" href="group___c_a_n.html#gaf7358e5ef5143e39c10b46d9cb592485">canRequestBusStatistics()</a> from your application periodically (for example, once per second) to request the data from the driver and then call <a class="el" href="group___c_a_n.html#ga8d78ccbef4e6038ff63662f06b7cde65">canGetBusStatistics()</a> with the same rate to obtain the latest reported data.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN channel.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#ga8d78ccbef4e6038ff63662f06b7cde65">canGetBusStatistics()</a> </dd></dl>

</div>
</div>
<a id="gaba3573e69435d87047c190520efdf5e5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaba3573e69435d87047c190520efdf5e5">&#9670;&nbsp;</a></span>canRequestChipStatus()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canRequestChipStatus </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function is a dummy implementation for code portability. The Linux implementation of <a class="el" href="group___c_a_n.html#gaca3da209fe673b3838a50a3abe831855">canReadStatus()</a> will return the latest status without need of an additional call to <a class="el" href="group___c_a_n.html#gaba3573e69435d87047c190520efdf5e5">canRequestChipStatus()</a>, unlike the Windows counterpart.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN channel.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero)</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#gaca3da209fe673b3838a50a3abe831855">canReadStatus()</a> </dd></dl>

</div>
</div>
<a id="gaecc8b56e75cf68548af53b2d432079af"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaecc8b56e75cf68548af53b2d432079af">&#9670;&nbsp;</a></span>canResetBus()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canResetBus </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function tries to reset a CAN bus controller by taking the channel off bus and then on bus again (if it was on bus before the call to <a class="el" href="group___c_a_n.html#gaecc8b56e75cf68548af53b2d432079af">canResetBus()</a>.)</p>
<p>This function will affect the hardware (and cause a real reset of the CAN chip) only if <em>hnd</em> is the only handle open on the channel. If there are other open handles, this operation will not affect the hardware.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open circuit.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#ga99c7c99cc71580f8099a1407f4f9ea1a">canBusOn()</a>, <a class="el" href="group___c_a_n.html#gaf1786cfbfd542b18b9c599d278837bd9">canBusOff()</a> </dd></dl>

</div>
</div>
<a id="gabe5023aa5de3115de946a6a10232fe84"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabe5023aa5de3115de946a6a10232fe84">&#9670;&nbsp;</a></span>canSetAcceptanceFilter()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canSetAcceptanceFilter </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>code</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>is_extended</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This routine sets the message acceptance filters on a CAN channel.</p>
<p>Format of <em>code</em> and <em>mask:</em> </p>
<ul>
<li>A binary 1 in a mask means "the corresponding bit in the code is
    relevant" </li>
<li>A binary 0 in a mask means "the corresponding bit in the code is not
    relevant" </li>
<li>A relevant binary 1 in a code means "the corresponding bit in the
    identifier must be 1" </li>
<li>A relevant binary 0 in a code means "the corresponding bit in the
    identifier must be 0"</li>
</ul>
<p>In other words, the message is accepted if ((code XOR id) AND mask) == 0.</p>
<p><em>extended</em> should be set to:</p>
<ul>
<li><code>0</code> (FALSE): if the code and mask shall apply to 11-bit CAN identifiers. </li>
<li><code>1</code> (TRUE): if the code and mask shall apply to 29-bit CAN identifiers.</li>
</ul>
<p>If you want to remove a filter, call <a class="el" href="group___c_a_n.html#gabe5023aa5de3115de946a6a10232fe84">canSetAcceptanceFilter()</a> with the mask set to <code>0</code>.</p>
<p>On some boards the acceptance filtering is done by the CAN hardware; on other boards (typically those with an embedded CPU,) the acceptance filtering is done by software. <a class="el" href="group___c_a_n.html#gabe5023aa5de3115de946a6a10232fe84">canSetAcceptanceFilter()</a> behaves in the same way for all boards, however.</p>
<p><a class="el" href="group___c_a_n.html#gabe5023aa5de3115de946a6a10232fe84">canSetAcceptanceFilter()</a> and <a class="el" href="group___c_a_n.html#gaa4ffd2fad1932ad5763c2c923a1a12d8">canAccept()</a> both serve the same purpose but the former can set the code and mask in just one call.</p>
<dl class="section note"><dt>Note</dt><dd>You can set the extended code and mask only on CAN boards that support extended identifiers.</dd>
<dd>
Acceptance filters for 11-bit and 29-bit (ext) are independent, meaning 11-bit filters will not affect 29-bit can frames and vice versa.</dd>
<dd>
Not all CAN boards support different masks for standard and extended CAN identifiers.</dd>
<dd>
Not implemented in linux.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">code</td><td>The acceptance code to set. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>The acceptance mask to set. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">is_extended</td><td>Select 29-bit CAN identifiers.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_user_guide_send_recv.html#section_user_guide_send_recv_filters">Acceptance Filters</a> </dd>
<dd>
<a class="el" href="group___c_a_n.html#gaa4ffd2fad1932ad5763c2c923a1a12d8">canAccept()</a> </dd></dl>

</div>
</div>
<a id="gafca31590718ac7101d065b0c18b2410e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafca31590718ac7101d065b0c18b2410e">&#9670;&nbsp;</a></span>canSetBusOutputControl()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canSetBusOutputControl </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned int&#160;</td>
          <td class="paramname"><em>drivertype</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function sets the driver type for a CAN controller. This corresponds loosely to the bus output control register in the CAN controller, hence the name of this function. CANlib does not allow for direct manipulation of the bus output control register; instead, symbolic constants are used to select the desired driver type.</p>
<dl class="section note"><dt>Note</dt><dd>Not all CAN driver types are supported on all cards.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">drivertype</td><td>Can driver type, <a class="el" href="canlib_8h.html#canDRIVER_xxx">canDRIVER_xxx</a>)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#ga1683419d56af8afdbfc9184678c82fdd">canGetBusOutputControl()</a> </dd></dl>

</div>
</div>
<a id="ga7eb8c2e92cfae57e7ec5031818524301"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7eb8c2e92cfae57e7ec5031818524301">&#9670;&nbsp;</a></span>canSetBusParams()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canSetBusParams </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>freq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>tseg1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>tseg2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>sjw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>noSamp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>syncmode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function sets the nominal bus timing parameters for the specified CAN controller.</p>
<p>The library provides default values for <em>tseg1</em>, <em>tseg2</em>, <em>sjw</em> and <em>noSamp</em> when <em>freq</em> is specified to one of the pre-defined constants, <a class="el" href="canlib_8h.html#canBITRATE_xxx">canBITRATE_xxx</a> for classic CAN and <a class="el" href="canlib_8h.html#canFD_BITRATE_xxx">canFD_BITRATE_xxx</a> for CAN FD.</p>
<p>If <em>freq</em> is any other value, no default values are supplied by the library.</p>
<p>If you are using multiple handles to the same physical channel, for example if you are writing a threaded application, you must call <a class="el" href="group___c_a_n.html#gaf1786cfbfd542b18b9c599d278837bd9">canBusOff()</a> once for each handle. The same applies to <a class="el" href="group___c_a_n.html#ga99c7c99cc71580f8099a1407f4f9ea1a">canBusOn()</a> - the physical channel will not go off bus until the last handle to the channel goes off bus.</p>
<dl class="section note"><dt>Note</dt><dd>The value of sjw should normally be less than tseg1 and tseg2.</dd></dl>
<p>Use <a class="el" href="group___c_a_n.html#gac34c1577cae55385250e7412513c8cbd">canSetBusParamsC200()</a> to set the bus timing parameters in the ubiquitous 82c200 bit-timing register format.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN controller. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">freq</td><td>Bit rate (measured in bits per second); or one of the predefined constants (<a class="el" href="canlib_8h.html#canBITRATE_xxx">canBITRATE_xxx</a> for classic CAN and <a class="el" href="canlib_8h.html#canFD_BITRATE_xxx">canFD_BITRATE_xxx</a> for CAN FD). </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tseg1</td><td>Time segment 1, that is, the number of quanta from (but not including) the Sync Segment to the sampling point. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tseg2</td><td>Time segment 2, that is, the number of quanta from the sampling point to the end of the bit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sjw</td><td>The Synchronization Jump Width. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">noSamp</td><td>The number of sampling points; can be 1 or 3. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">syncmode</td><td>Unsupported and ignored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_user_guide_chips_channels.html#section_user_guide_init_bit_rate_can">Set CAN Bitrate</a>, <a class="el" href="page_user_guide_chips_channels.html#section_user_guide_init_bit_rate_canfd">Set CAN FD Bitrate</a>, </dd>
<dd>
<a class="el" href="group___c_a_n.html#gafcd85fbac103dcb123f4cd609be6fa14">canSetBusParamsFd()</a>, <a class="el" href="group___c_a_n.html#gac34c1577cae55385250e7412513c8cbd">canSetBusParamsC200()</a>, <a class="el" href="group___c_a_n.html#gaf2a734c0486030610389331685a3827a">canGetBusParams()</a> </dd>
<dd>
<a class="el" href="group___c_a_n.html#ga50f169c6f9dd6df93b17c322e8e4fd00">canSetBusParamsTq()</a>, <a class="el" href="group___c_a_n.html#ga4beeb28ede2e21a2988076e66f873723">canSetBusParamsFdTq()</a>, <a class="el" href="group___c_a_n.html#gae517a9c243c446e040f6f8898d09a677">canGetBusParamsTq()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="busparams_8c-example.html#a6">busparams.c</a>, <a class="el" href="cancount_8c-example.html#a7">cancount.c</a>, <a class="el" href="canfdmonitor_8c-example.html#a5">canfdmonitor.c</a>, <a class="el" href="canfdwrite_8c-example.html#a7">canfdwrite.c</a>, <a class="el" href="canmonitor_8c-example.html#a25">canmonitor.c</a>, <a class="el" href="how-to_2c_2open_channels_8c-example.html#a3">how-to/c/openChannels.c</a>, <a class="el" href="simplewrite_8c-example.html#a19">simplewrite.c</a>, <a class="el" href="tutorial_2c_2_monitor_can_channel_8c-example.html#a8">tutorial/c/MonitorCanChannel.c</a>, <a class="el" href="tutorial_2c_2_send_message_8c-example.html#a5">tutorial/c/SendMessage.c</a>, and <a class="el" href="writeloop_8c-example.html#a7">writeloop.c</a>.</dd>
</dl>
</div>
</div>
<a id="gac34c1577cae55385250e7412513c8cbd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac34c1577cae55385250e7412513c8cbd">&#9670;&nbsp;</a></span>canSetBusParamsC200()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canSetBusParamsC200 </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>btr0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>btr1</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function sets the bus timing parameters using the same convention as the 82c200 CAN controller (which is the same as many other CAN controllers, for example, the 82527.)</p>
<p>To calculate the bit timing parameters, you can use the bit timing calculator that is included with CANlib SDK. Look in the BIN directory.</p>
<p>82c200 Bit Timing</p>
<ul>
<li><em>btr0</em> [b7..b6]: SJW - 1 </li>
<li><em>btr0</em> [b5..b0]: Prescaler -1 </li>
<li><em>btr1</em> [b7]: <code>1</code>: 3 samples, <code>0</code>: 1 samples </li>
<li><em>btr1</em> [b6..b4]: tseg2 - 1 </li>
<li><em>btr1</em> [b3..b0]: tseg1 - 2</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>CANlib will always behave as if the clock frequency is 16 MHz. It does not matter if the device has a different physical clock, since this will be compensated for by the driver.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open CAN circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">btr0</td><td>The desired bit timing, formatted as the contents of the BTR0 register in the 82c200. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">btr1</td><td>The desired bit timing, formatted as the contents of the BTR1 register in the 82c200.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_user_guide_chips_channels.html#section_user_guide_init_bit_rate_can">Set CAN Bitrate</a>, <a class="el" href="group___c_a_n.html#ga7eb8c2e92cfae57e7ec5031818524301">canSetBusParams()</a> </dd>
<dd>
<a class="el" href="group___c_a_n.html#ga50f169c6f9dd6df93b17c322e8e4fd00">canSetBusParamsTq()</a> </dd></dl>

</div>
</div>
<a id="gafcd85fbac103dcb123f4cd609be6fa14"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafcd85fbac103dcb123f4cd609be6fa14">&#9670;&nbsp;</a></span>canSetBusParamsFd()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canSetBusParamsFd </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>freq_brs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>tseg1_brs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>tseg2_brs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>sjw_brs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function sets the data phase bus timing parameters for the specified CAN controller.</p>
<p>The library provides default values for <em>tseg1_brs</em>, <em>tseg2_brs</em> and <em>sjw_brs</em> when <em>freq_brs</em> is specified to one of the pre-defined constants, <a class="el" href="canlib_8h.html#canFD_BITRATE_xxx">canFD_BITRATE_xxx</a>.</p>
<p>If <em>freq_brs</em> is any other value, no default values are supplied by the library.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN controller. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">freq_brs</td><td>CAN FD data bit rate (measured in bits per second); or one of the predefined constants <a class="el" href="canlib_8h.html#canFD_BITRATE_xxx">canFD_BITRATE_xxx</a>. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tseg1_brs</td><td>Time segment 1, that is, the number of quanta from (but not including) the Sync Segment to the sampling point. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tseg2_brs</td><td>Time segment 2, that is, the number of quanta from the sampling point to the end of the bit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sjw_brs</td><td>The Synchronization Jump Width.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#ga4beeb28ede2e21a2988076e66f873723">canSetBusParamsFdTq()</a>, <a class="el" href="group___c_a_n.html#ga2ca01a0c71b8c3b5204f07b051eb4758">canGetBusParamsFdTq()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="canfdmonitor_8c-example.html#a7">canfdmonitor.c</a>, <a class="el" href="canfdwrite_8c-example.html#a9">canfdwrite.c</a>, and <a class="el" href="how-to_2c_2open_channels_8c-example.html#a8">how-to/c/openChannels.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga4beeb28ede2e21a2988076e66f873723"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4beeb28ede2e21a2988076e66f873723">&#9670;&nbsp;</a></span>canSetBusParamsFdTq()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canSetBusParamsFdTq </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a>&#160;</td>
          <td class="paramname"><em>arbitration</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a>&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set bus parameters for the specified CAN controller.</p>
<p>The channel <b>MUST</b> be opened with flags <a class="el" href="canlib_8h.html#a10aad075bfb9891aa98cf3c131977dc3">canOPEN_CAN_FD</a> or <a class="el" href="canlib_8h.html#a692d91db67e06e0c11e9076141319e35">canOPEN_CAN_FD_NONISO</a>, see <a class="el" href="group___c_a_n.html#gac377d182232fb4ec2fed881c2b9ab300">canOpenChannel()</a>. In the case of classic can, use <a class="el" href="group___c_a_n.html#ga50f169c6f9dd6df93b17c322e8e4fd00">canSetBusParamsTq()</a> instead.</p>
<p>To get device specific limits of bus parameters, see <a class="el" href="canlib_8h.html#ad4a719c4336ae1ec409bc835a9321f05">canCHANNELDATA_BUS_PARAM_LIMITS</a>.</p>
<p>The <a href="https://www.kvaser.com/support/calculators/can-fd-bit-timing-calculator/">Kvaser Bit Timing calculator</a>, available on the Kvaser website, can be used to calculate specific bit rates.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open CAN circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">arbitration</td><td>See <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>See <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a></td></tr>
  </table>
  </dd>
</dl>
<p>return canOK (zero) if success return canERR_xxx (negative) if failure </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="example_2c_2busparams_tq_8c-example.html#a7">example/c/busparams_tq.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga50f169c6f9dd6df93b17c322e8e4fd00"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga50f169c6f9dd6df93b17c322e8e4fd00">&#9670;&nbsp;</a></span>canSetBusParamsTq()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canSetBusParamsTq </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a>&#160;</td>
          <td class="paramname"><em>nominal</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set bus parameters for the specified CAN controller (classic CAN).</p>
<p>If the channel is opened (see <a class="el" href="group___c_a_n.html#gac377d182232fb4ec2fed881c2b9ab300">canOpenChannel()</a>) with flags <a class="el" href="canlib_8h.html#a10aad075bfb9891aa98cf3c131977dc3">canOPEN_CAN_FD</a> or <a class="el" href="canlib_8h.html#a692d91db67e06e0c11e9076141319e35">canOPEN_CAN_FD_NONISO</a>, use <a class="el" href="group___c_a_n.html#ga4beeb28ede2e21a2988076e66f873723">canSetBusParamsFdTq()</a> instead.</p>
<p>To get device specific limits of bus parameters, see <a class="el" href="canlib_8h.html#ad4a719c4336ae1ec409bc835a9321f05">canCHANNELDATA_BUS_PARAM_LIMITS</a>.</p>
<p>The <a href="https://www.kvaser.com/support/calculators/can-fd-bit-timing-calculator/">Kvaser Bit Timing calculator</a>, available on the Kvaser website, can be used to calculate specific bit rates.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open CAN circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">nominal</td><td>See <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a></td></tr>
  </table>
  </dd>
</dl>
<p>return canOK (zero) if success return canERR_xxx (negative) if failure </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="example_2c_2busparams_tq_8c-example.html#a5">example/c/busparams_tq.c</a>.</dd>
</dl>
</div>
</div>
<a id="gae0bd6419b7a004c439dc582a53815c78"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae0bd6419b7a004c439dc582a53815c78">&#9670;&nbsp;</a></span>canSetDriverMode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canSetDriverMode </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>lineMode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>resNet</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function sets the current CAN bus driver mode. This is typically a mode like sleep, wakeup, standby, fast mode, etc. The different modes are almost always hardware dependent and requires special DRVcan cables. As an example, the DRVcan S implements J2411 compliant single-wire CAN and supports four line modes, namely Normal, Sleep, Fast and Wakeup.</p>
<p>Standard ISO 11898 CAN do not support any of these bus driver modes.</p>
<dl class="section note"><dt>Note</dt><dd>The bus driver mode is typically used to control things like one- or two-wire mode, sleep mode, and so on. It requires special support in the CAN driver circuit.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>An open handle to a CAN circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">lineMode</td><td>An int which defines the line mode, <a class="el" href="canstat_8h.html#canTRANSCEIVER_LINEMODE_xxx">canTRANSCEIVER_LINEMODE_xxx</a>. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">resNet</td><td>An int which defines the resnet mode. Set this parameter to <a class="el" href="canstat_8h.html#a3b7a3241ee88e905792b2630634a8373">canTRANSCEIVER_RESNET_NA</a> unless you have good reasons to set it to something else.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#gacbb6c333badfaa092e9b239ad99478c9">canGetDriverMode()</a></dd></dl>
<dl class="section note"><dt>Note</dt><dd>Not implemented in linux. </dd></dl>

</div>
</div>
<a id="gaa5dd0f277c7059169055321fbda87486"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa5dd0f277c7059169055321fbda87486">&#9670;&nbsp;</a></span>canSetNotify()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canSetNotify </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void(*)(<a class="el" href="structcan_notify_data.html">canNotifyData</a> *)&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>notifyFlags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>tag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function associates a callback function with the CAN circuit.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open CAN circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>Handle to callback routine. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">notifyFlags</td><td>The events specified with <a class="el" href="canstat_8h.html#canNOTIFY_xxx">canNOTIFY_xxx</a>, for which callback should be called. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tag</td><td>Pointer to user defined data. Passed to callback in the <a class="el" href="structcan_notify_data.html">canNotifyData</a> struct.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="canmonitor_8c-example.html#a19">canmonitor.c</a>, and <a class="el" href="simplewrite_8c-example.html#a21">simplewrite.c</a>.</dd>
</dl>
</div>
</div>
<a id="gaf38b95fce4930347d9986887ec046e13"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf38b95fce4930347d9986887ec046e13">&#9670;&nbsp;</a></span>canTranslateBaud()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canTranslateBaud </td>
          <td>(</td>
          <td class="paramtype">long *const&#160;</td>
          <td class="paramname"><em>freq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *const&#160;</td>
          <td class="paramname"><em>tseg1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *const&#160;</td>
          <td class="paramname"><em>tseg2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *const&#160;</td>
          <td class="paramname"><em>sjw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *const&#160;</td>
          <td class="paramname"><em>nosamp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *const&#160;</td>
          <td class="paramname"><em>syncMode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function translates the <a class="el" href="canlib_8h.html#canBITRATE_xxx">canBITRATE_xxx</a> constants to their corresponding bus parameter values. At return, this <em>freq</em> contains the actual bit rate (in bits per second). <em>TSeg1</em> is the number of quanta (less one) in a bit before the sampling point. <em>TSeg2</em> is the number of quanta after the sampling point.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">freq</td><td>A pointer to a <code>DWORD</code> which contains the <a class="el" href="canlib_8h.html#canBITRATE_xxx">canBITRATE_xxx</a> constant to translate. The bitrate constant value is overwritten with the frequency value. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">tseg1</td><td>A pointer to a buffer which receives the Time segment 1, that is, the number of quanta from (but not including) the Sync Segment to the sampling point. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">tseg2</td><td>A pointer to a buffer which receives the Time segment 2, that is, the number of quanta from the sampling point to the end of the bit. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">sjw</td><td>A pointer to a buffer which receives the Synchronization Jump Width. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">nosamp</td><td>A pointer to a buffer which receives the number of sampling points. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">syncMode</td><td>Unsupported, always read as zero. May be set to NULL.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#ga7eb8c2e92cfae57e7ec5031818524301">canSetBusParams()</a> </dd></dl>

</div>
</div>
<a id="ga62c185329d6741c90102511e2f37983e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga62c185329d6741c90102511e2f37983e">&#9670;&nbsp;</a></span>canWrite()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canWrite </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>dlc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function sends a CAN message. The call returns immediately after queuing the message to the driver so the message has not necessarily been transmitted.</p>
<p>If you are using the same channel via multiple handles, note that the default behaviour is that the different handles will "hear" each other just as if each handle referred to a channel of its own. If you open, say, channel 0 from thread A and thread B and then send a message from thread A, it will be "received" by thread B. This behaviour can be changed using <a class="el" href="canlib_8h.html#a86f7ce6c809f30983b69ead49d793689">canIOCTL_SET_LOCAL_TXECHO</a>.</p>
<dl class="section note"><dt>Note</dt><dd>The message has been queued for transmission when this calls return. It has not necessarily been sent.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open CAN circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>The identifier of the CAN message to send. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">msg</td><td>A pointer to the message data, or <code>NULL</code>. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">dlc</td><td>The length of the message in bytes.<br />
 For Classic CAN dlc can be at most 8, unless <a class="el" href="canlib_8h.html#a933708eecbae36802f143ee06126301d">canOPEN_ACCEPT_LARGE_DLC</a> is used.<br />
 For CAN FD dlc can be one of the following 0-8, 12, 16, 20, 24, 32, 48, 64. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">flag</td><td>A combination of message flags, <a class="el" href="canstat_8h.html#canMSG_xxx">canMSG_xxx</a> (including <a class="el" href="canstat_8h.html#canFDMSG_xxx">canFDMSG_xxx</a> if the CAN FD protocol is enabled). Use this parameter to send extended (29-bit) frames and/or remote frames. Use <a class="el" href="canstat_8h.html#ade936f23b4b303d64187b4c6589c9c10">canMSG_EXT</a> and/or <a class="el" href="canstat_8h.html#a687df04559a9995e0bec503655454eb3">canMSG_RTR</a> for this purpose.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_user_guide_send_recv.html#section_user_guide_send_recv_sending">Sending Messages</a> </dd>
<dd>
<a class="el" href="group___c_a_n.html#ga304cb3a7bc2874c1f8ad361a911bcd5f">canWriteSync()</a>, <a class="el" href="group___c_a_n.html#ga47d03bfcc31e290284e65211b61f15f3">canWriteWait()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="canfdwrite_8c-example.html#a12">canfdwrite.c</a>, <a class="el" href="simplewrite_8c-example.html#a28">simplewrite.c</a>, and <a class="el" href="tutorial_2c_2_send_message_8c-example.html#a8">tutorial/c/SendMessage.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga304cb3a7bc2874c1f8ad361a911bcd5f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga304cb3a7bc2874c1f8ad361a911bcd5f">&#9670;&nbsp;</a></span>canWriteSync()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canWriteSync </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Waits until all CAN messages for the specified handle are sent, or the timeout period expires.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open CAN circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>The timeout in milliseconds. 0xFFFFFFFF gives an infinite timeout.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if the queue emptied before the timeout period came to its end. </dd>
<dd>
<a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7acd1c4c3a87dd24f0a43753ee4bfe7993">canERR_TIMEOUT</a> (negative) not all messages were transmitted when the timeout occurred. </dd>
<dd>
<a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7ae22cf05933b31e181f580ee702006f26">canERR_PARAM</a> (negative) This could be caused by an erroneous parameter, or if you have turned TXACKs off (by using <a class="el" href="group__can__general.html#gaeaa24db97af22478ca51d48636c7bb12">canIoCtl()</a>) because if you do you can't use this call. The driver simply doesn't know when all the messages are sent! </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#ga62c185329d6741c90102511e2f37983e">canWrite()</a>, <a class="el" href="group___c_a_n.html#ga47d03bfcc31e290284e65211b61f15f3">canWriteWait()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="canfdwrite_8c-example.html#a16">canfdwrite.c</a>, <a class="el" href="simplewrite_8c-example.html#a29">simplewrite.c</a>, and <a class="el" href="tutorial_2c_2_send_message_8c-example.html#a9">tutorial/c/SendMessage.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga47d03bfcc31e290284e65211b61f15f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga47d03bfcc31e290284e65211b61f15f3">&#9670;&nbsp;</a></span>canWriteWait()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> canWriteWait </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#a75f2e3a4c7b1e47c8c6b25b76975b510">CanHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>dlc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>flag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function sends a CAN message and returns when the message has been successfully transmitted, or the timeout expires.</p>
<p>This is a convenience function that combines <a class="el" href="group___c_a_n.html#ga62c185329d6741c90102511e2f37983e">canWrite()</a> and <a class="el" href="group___c_a_n.html#ga304cb3a7bc2874c1f8ad361a911bcd5f">canWriteSync()</a>.</p>
<p>If you are using the same channel via multiple handles, note that the default behaviour is that the different handles will "hear" each other just as if each handle referred to a channel of its own. If you open, say, channel 0 from thread A and thread B and then send a message from thread A, it will be "received" by thread B. This behaviour can be changed using <a class="el" href="canlib_8h.html#a86f7ce6c809f30983b69ead49d793689">canIOCTL_SET_LOCAL_TXECHO</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open CAN circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>The identifier of the CAN message to send. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">msg</td><td>A pointer to the message data, or <code>NULL</code>. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">dlc</td><td>The length of the message in bytes.<br />
 For Classic CAN dlc can be at most 8, unless <a class="el" href="canlib_8h.html#a933708eecbae36802f143ee06126301d">canOPEN_ACCEPT_LARGE_DLC</a> is used.<br />
 For CAN FD dlc can be one of the following 0-8, 12, 16, 20, 24, 32, 48, 64. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">flag</td><td>A combination of message flags, <a class="el" href="canstat_8h.html#canMSG_xxx">canMSG_xxx</a>. Use this parameter to send extended (29-bit) frames and/or remote frames. Use <a class="el" href="canstat_8h.html#ade936f23b4b303d64187b4c6589c9c10">canMSG_EXT</a> and/or <a class="el" href="canstat_8h.html#a687df04559a9995e0bec503655454eb3">canMSG_RTR</a> for this purpose. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>The timeout, in milliseconds. 0xFFFFFFFF gives an infinite timeout.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) if success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="canlib_8h.html#af74b97adce24c13d8ecc3388aee6e891">canIOCTL_SET_TXACK</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="writeloop_8c-example.html#a10">writeloop.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga03be920624427856a9fde821ef3f9136"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga03be920624427856a9fde821ef3f9136">&#9670;&nbsp;</a></span>kvBitrateToBusParamsFdTq()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> kvBitrateToBusParamsFdTq </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#ae3d1b041d62207d5336f93c089cd5b65">canHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>freqA</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>freqD</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> *&#160;</td>
          <td class="paramname"><em>arbitration</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="gaa666085d9544b2c8db002599595edc37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa666085d9544b2c8db002599595edc37">&#9670;&nbsp;</a></span>kvBitrateToBusParamsTq()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> kvBitrateToBusParamsTq </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="canlib_8h.html#ae3d1b041d62207d5336f93c089cd5b65">canHandle</a>&#160;</td>
          <td class="paramname"><em>hnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>freq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a> *&#160;</td>
          <td class="paramname"><em>nominal</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function translates the <a class="el" href="canlib_8h.html#canBITRATE_xxx">canBITRATE_xxx</a> constants to corresponding bus parameter values. At return <em>nominal</em> contains parameter values for the specified <em>freq</em>. If the channel is opened in CAN FD mode, see <a class="el" href="group___c_a_n.html#ga03be920624427856a9fde821ef3f9136">kvBitrateToBusParamsFdTq()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hnd</td><td>A handle to an open circuit. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">freq</td><td>Bitrate constant, <a class="el" href="canlib_8h.html#canBITRATE_xxx">canBITRATE_xxx</a>. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">nominal</td><td>A pointer to a <a class="el" href="structkv_bus_params_tq.html">kvBusParamsTq</a>, upon return receives the bus busparamters specified by <em>freq</em>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a> (zero) is success </dd>
<dd>
<a class="el" href="canstat_8h.html#canERR_xxx">canERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___c_a_n.html#ga50f169c6f9dd6df93b17c322e8e4fd00">canSetBusParamsTq()</a>, <a class="el" href="group___c_a_n.html#ga03be920624427856a9fde821ef3f9136">kvBitrateToBusParamsFdTq()</a> </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer"> (canlib 5.38) Tue Feb 15 2022</li>
  </ul>
</div>
</body>
</html>
